<?php 
drupal_add_js ( 'js/jquery.validate.min.js' );
drupal_add_js ( 'js/script.category.js' );
drupal_add_css ( 'css/style.dev1.css' );
?>
<div id="error">
    <ul></ul>
</div>
<form name="add_category" id="add_category" action="" method="POST">
    <div>
        <div class="node-form">
            <div class="standard">


                <div class="form-item">
                    <label for="cate_name">Tên danh mục: <span title="Trường bắt buộc." class="form-required">*</span></label>
                    <input type="text" value="<?php if($data['cate']) echo $data['cate']->cate_name ?>" size="60" id="cate_name" name="cate_name" maxlength="255">
                </div>
                <?php
                    if($data['parent_cate']) {
                ?>
                <div id="showcate" class="form-item">
                    <label style="float: left;">Danh mục cha:</label>
                    &nbsp;
                    <?php echo l($data['parent_cate']->cate_name, 'back-end/danhmuc/' . arg(2) . '/sub/' . hexID($data['parent_cate']->cate_id)) ?>
                </div>                
                <?php
                    }
                ?>    
                <input type="hidden" name="cate_parent" id="cate_parent" value="<?php echo $data['parent_cate'] != null ? $data['parent_cate']->cate_id : '0'; ?>" readonly="true" />
                <div class="resizable-textarea">
                    <label for="cate_message">Thông báo: </label>
                    <span>
                        <textarea class="form-textarea resizable textarea-processed" id="cate_message" name="cate_message" style="width:915px; height: 100px;"><?php if($data['cate']) echo $data['cate']->cate_message ?></textarea>
                        <div class="grippie" style="margin-right: -4px;"></div>
                    </span>                    
                </div>

                <div class="resizable-textarea">
                    <label for="cate_keyword">Từ khóa: </label>
                    <span>
                        <textarea class="form-textarea resizable textarea-processed" id="cate_keyword" name="cate_keyword" style="width:915px; height: 100px;"><?php if($data['cate']) echo $data['cate']->cate_keyword ?></textarea>
                        <div class="grippie" style="margin-right: -4px;"></div>
                    </span>                    
                </div>

                <div class="resizable-textarea">
                    <label for="cate_description">Mô tả: </label>
                    <span>
                        <textarea class="form-textarea resizable textarea-processed" id="cate_description" name="cate_description" style="width:915px; height: 100px;"><?php if($data['cate']) echo $data['cate']->cate_description ?></textarea>
                        <div class="grippie" style="margin-right: -4px;"></div>
                    </span>                    
                </div>

                <div class="form-item">
                    <label for="cate_position">Độ ưu tiên:</label>
                    <input type="text" value="<?php if($data['cate'])
                            echo $data['cate']->cate_position; else
                            echo '1'; ?>" id="cate_position" name="cate_position" maxlength="2" style="width: 20px;" >
                </div>   
                <?php
                    if (user_access('admin block')) {
                ?>
                <div class="form-item">
                    <label for="cate_status">Trạng thái:</label>
                    <select id="cate_status" name="cate_status">
                        <option value="<?php echo STATUS_SHOW ?>">Hiển thị</option>
                        <option <?php if($data['cate'] != null && $data['cate']->cate_status == STATUS_HIDE) echo 'selected="true"'; ?> value="<?php echo STATUS_HIDE ?>">Không hiển thị</option>
                    </select>
                </div>
                <?php        
                    } else {
                        echo '<input type="hidden" name="cate_status" value="' . ($data['cate']->cate_status == STATUS_HIDE ? STATUS_HIDE : STATUS_SHOW) . '" readonly="true" />';
                    }
                ?>
                <input type="submit" value="Lưu" />
                <input type="reset" rel="add_category" value="Nhập lại" />                
            </div>
        </div>
    </div>
</form>